using System.ComponentModel.DataAnnotations.Schema;
using UniversalAdmin.Domain.Entities;
using UniversalAdmin.Domain.DomainEvents;

namespace UniversalAdmin.Domain.Entities.App;

public class AppFile : EntityBase
{
    
    public string Name { get; set; } = null!; // 存储文件名
    public string OriginalName { get; set; } = null!; // 原始文件名
    public string Path { get; set; } = null!; // 存储路径
    public string Url { get; set; } = null!; // 访问URL
    public long Size { get; set; } // 文件大小
    public string MimeType { get; set; } = null!; // 文件类型
    public string FileName { get; set; } = null!;
   
    public Guid UuId { get; set; } // 上传用户ID (关联User.Id)

    // 领域事件发布
    public void OnCreated() => AddDomainEvent(new FileCreatedEvent(this));
    public void OnDeleted() => AddDomainEvent(new FileDeletedEvent(this));
}